import {createBrowserRouter, Navigate} from 'react-router-dom'
import React from 'react'
let Detail=React.lazy(()=>import('../page/detail/Detail'))
let Layout=React.lazy(()=>import('../page/layout/Layout'))
let Index=React.lazy(()=>import('../page/home/Index'))

export const route=[{
  path:'/home',
  element:<Index/>
}]


const routes=createBrowserRouter([{
  path:'/',
  element:<Layout/>,
  children:[
...route
    ,{
    path:'/',
    element:<Navigate to='/home'></Navigate>

  }]
  
},
{
  path:'/detail/:id',
  element:<Detail/>
}
])
export default routes